xen: credit2: avoid using cpumask_weight() in hot-paths
authorDario Faggioli <dfaggioli@suse.com>
Mon, 29 Jul 2019 10:49:09 +0000 (12:49 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 30 Jul 2019 11:20:14 +0000 (12:20 +0100)
commit1585ed3c702e680ae492d852c8cff62cf300df99
treeeb71a7ece380098266a1b03aaa4b7ede2144e904
parent850454cf9fa417e079c48a872ead17636a5be44f
xen: credit2: avoid using cpumask_weight() in hot-paths

cpumask_weight() is known to be expensive. In Credit2, we use it in
load-balancing, but only for knowing how many CPUs are active in a
runqueue.

Keeping such count in an integer field of the per-runqueue data
structure we have, completely avoids the need for cpumask_weight().

While there, remove as much other uses of it as we can, even if not in
hot-paths.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c